package cn.edu.nju.software.cdiy.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import cn.edu.nju.software.cdiy.bean.Brand;
import cn.edu.nju.software.cdiy.bean.Chassis;
import cn.edu.nju.software.cdiy.bean.Hardware;
import cn.edu.nju.software.cdiy.bean.HardwareSet;
import cn.edu.nju.software.cdiy.util.*;

public interface Dao<T> {
	public List<Hardware> getNewestList();

	public List<Hardware> getHottestList();

	public List<Brand> getBrandList();

	public List<T> filter(int page, Map<String, List<Integer>> map, SortType st, SortWay sw,HardwareSet hs);

	// 获得分页的条数
	// 筛选的分页
	public int filterPageNum(Map<String, List<Integer>> map,HardwareSet hs);

	// 匹配的分页
	public int getListPageNum(HardwareSet hs);

	public List<T> search(String keywords, int page);

	public HashMap<String, List<Item>> getFilterBoard();

	public T getOneById(int id);

	public Map<String, List<String>> getInsertboard(); // 插入硬件界面的外键类型面板

	public boolean insertHardware(Map<String, List<String>> map); // 插入新的硬件

	public void save(T t);
	
	public List<T> getOneBySupplierID(int id);
}
